home *** CD-ROM | disk | FTP | other *** search
/ Fritz: All Fritz / All Fritz.zip / All Fritz / FILES / EDUCMATH / STATHELP.LZH / SINSTALL.BAT < prev   
DOS Batch File  |  1991-12-26  |  10KB  |  247 lines

  1. REM --- SINSTALL.BAT -- INSTALLATION BATCH FILE FOR STATHELP
  2. @ECHO OFF
  3. CLS
  4. IF %1!==! GOTO USAGE
  5. IF %2!==! GOTO USAGE
  6. IF %1==A: IF %1==%2 GOTO USAGE
  7. IF %1==a: IF %1==%2 GOTO USAGE
  8. IF %1==B: IF %1==%2 GOTO USAGE
  9. IF %1==b: IF %1==%2 GOTO USAGE
  10. IF %2==A: GOTO SPACE
  11. IF %2==a: GOTO SPACE
  12. IF %2==B: GOTO SPACE
  13. IF %2==b: GOTO SPACE
  14. GOTO CHK2DRIV
  15. :SPACE
  16. @ECHO  
  17. @ECHO     YOU HAVE ELECTED TO INSTALL THE STATHELP PROGRAMS ON A
  18. @ECHO                   FLOPPY-DISK DRIVE, %2.
  19. @ECHO  
  20. @ECHO          This is acceptable ONLY IF Drive %2 is A 3.5" Drive or a
  21. @ECHO     High Density 5.25" Drive, with at least 470K bytes of free space.
  22. @ECHO          If you haven't already done so, insert an empty FORMATTED
  23. @ECHO     diskette in Drive %2, and be sure the door is closed.
  24. @ECHO          Also be sure that the diskette is NOT WRITE-PROTECTED.
  25. @ECHO  
  26. @ECHO                  Then press any key to continue
  27. @ECHO  (or press [CTRL] & [BREAK] keys, together, to ABORT the installation.)
  28. PAUSE>NUL
  29. :CHK2DRIV
  30. @ECHO  
  31. @ECHO   Checking Specified Drive to Install TO
  32. @ECHO ECHO XXXX>%2\TEST.TXT
  33. IF NOT EXIST %2\TEST.TXT GOTO BAD2DRIVE
  34. DEL %2\TEST.TXT
  35. @ECHO  
  36. @ECHO   OK -- TO_Drive exists -- Continuing
  37. IF %2==A: GOTO CHKFROM
  38. IF %2==a: GOTO CHKFROM
  39. IF %2==B: GOTO CHKFROM
  40. IF %2==b: GOTO CHKFROM
  41. IF %3!==! GOTO SHDIR
  42. @ECHO  
  43. @ECHO   Checking for existence of specified TO_Directory
  44. @ECHO   (Ignore a "File creation error" message, if it appears)
  45. @ECHO ECHO XXXX>%2%3\TEST.TXT
  46. IF EXIST %2%3\TEST.TXT DEL %2%3\TEST.TXT GOTO CHKFROM 
  47. @ECHO  
  48. @ECHO 
  49. @ECHO   You have specified a directory, %3, that doesn't exist yet.
  50. @ECHO   It will now be created, unless you choose to ABORT the installation
  51. @ECHO   at this point.  To ABORT, simultaneously press the [CTRL] and [BREAK] 
  52. @ECHO   keys, then answer Y (Yes) when DOS queries, "Terminate batch job?"
  53. @ECHO   Otherwise, continue with the installation by pressing any other key.
  54. PAUSE>NUL
  55. @ECHO  
  56. @ECHO   Proceeding to create %3 Directory on Drive %2
  57. MD %2%3
  58. @ECHO ECHO XXXX>%2%3\TEST.TXT
  59. IF NOT EXIST %2%3\TEST.TXT GOTO BAD2DIR
  60. DEL %2%3\TEST.TXT
  61. @ECHO  
  62. @ECHO   Directory %3 created on Drive %2
  63. GOTO CHKFROM
  64. :SHDIR
  65. @ECHO  
  66. @ECHO   No To_Directory name specified -- default \STATHELP will be created
  67. @ECHO   (Ignore a "File creation error" message, if it appears)
  68. @ECHO ECHO XXXX>%2\STATHELP\TEST.TXT
  69. IF EXIST %2\STATHELP\TEST.TXT DEL %2\STATHELP\TEST.TXT GOTO CHKFROM 
  70. MD %2\STATHELP
  71. @ECHO ECHO XXXX>%2\STATHELP\TEST.TXT
  72. IF NOT EXIST %2\STATHELP\TEST.TXT GOTO BAD2DIR
  73. DEL %2\STATHELP\TEST.TXT
  74. :CHKFROM
  75. @ECHO  
  76. @ECHO   Checking specified Drive to install FROM
  77. IF NOT EXIST %1\SHZIPARC.EXE GOTO BADFROM
  78. @ECHO  
  79. @ECHO   OK -- Archive file SHZIPARC.EXE found on Drive %1
  80. @ECHO  
  81. @ECHO   Beginning installation -- The next series of messages will come from
  82. @ECHO                             the self-executing archive file SHZIPARC.EXE
  83. @ECHO  
  84. IF %2==A: GOTO TOFLOPPY
  85. IF %2==a: GOTO TOFLOPPY
  86. IF %2==B: GOTO TOFLOPPY
  87. IF %2==b: GOTO TOFLOPPY
  88. IF %3!==! %1SHZIPARC %2\STATHELP
  89. IF %3!==! GOTO CHKDINST
  90. %1SHZIPARC %2%3
  91. IF NOT EXIST %2%3\WATSTAT.EXE GOTO ZIPERROR
  92. IF NOT EXIST %2%3\WATSTAT.TXT GOTO ZIPERROR
  93. IF NOT EXIST %2%3\WATSTAT.HLP GOTO ZIPERROR
  94. IF NOT EXIST %2%3\WATSTAT.INX GOTO ZIPERROR
  95. IF NOT EXIST %2%3\WATUT.EXE GOTO ZIPERROR
  96. IF NOT EXIST %2%3\LOOKUP.EXE GOTO ZIPERROR
  97. IF NOT EXIST %2%3\RANDO.EXE GOTO ZIPERROR
  98. REM IF NOT EXIST %2%3\SHMANUAL.DOC GOTO ZIPERROR
  99. GOTO ENJOY
  100. :CHKDINST
  101. IF NOT EXIST %2\STATHELP\WATSTAT.EXE GOTO ZIPERROR
  102. IF NOT EXIST %2\STATHELP\WATSTAT.TXT GOTO ZIPERROR
  103. IF NOT EXIST %2\STATHELP\WATSTAT.HLP GOTO ZIPERROR
  104. IF NOT EXIST %2\STATHELP\WATSTAT.INX GOTO ZIPERROR
  105. IF NOT EXIST %2\STATHELP\WATUT.EXE GOTO ZIPERROR
  106. IF NOT EXIST %2\STATHELP\LOOKUP.EXE GOTO ZIPERROR
  107. IF NOT EXIST %2\STATHELP\RANDO.EXE GOTO ZIPERROR
  108. REM IF NOT EXIST %2\STATHELP\SHMANUAL.DOC GOTO ZIPERROR
  109. GOTO ENJOY
  110. :TOFLOPPY
  111. %1SHZIPARC %2
  112. IF ERRORLEVEL 50 GOTO OOPS
  113. IF NOT EXIST %2\WATSTAT.EXE GOTO ZIPERROR
  114. IF NOT EXIST %2\WATSTAT.TXT GOTO ZIPERROR
  115. IF NOT EXIST %2\WATSTAT.HLP GOTO ZIPERROR
  116. IF NOT EXIST %2\WATSTAT.INX GOTO ZIPERROR
  117. IF NOT EXIST %2\WATUT.EXE GOTO ZIPERR0R
  118. IF NOT EXIST %2\LOOKUP.EXE GOTO ZIPERROR
  119. IF NOT EXIST %2\RANDO.EXE GOTO ZIPERROR
  120. REM IF NOT EXIST %2\SHMANUAL.DOC GOTO ZIPERROR
  121. :ENJOY
  122. @ECHO  
  123. @ECHO  ************** INSTALLATION COMPLETED SUCCESSFULLY *******************
  124. @ECHO  
  125. @ECHO    FINAL NOTES:
  126. @ECHO  
  127. @ECHO   1) A mini-manual for the STATHELP programs, called SHMANUAL.DOC, has
  128. @ECHO   been installed along with the program files.  SHMANUAL.DOC is a text
  129. @ECHO   file, which you can read with any text editor or word processor.  
  130. @ECHO   Or, make a hard copy of this file on your printer by typing:
  131. @ECHO                      PRINT SHMANUAL.DOC   
  132. @ECHO   from the DOS command line (after changing to the Drive and Directory
  133. @ECHO   where SHMANUAL has just been installed).
  134. @ECHO  
  135. @ECHO   2) To run any of the STATHELP programs, first change to the Drive
  136. @ECHO   and Directory where they were just installed, and then type the name
  137. @ECHO   of the program you want to run: WATSTAT, LOOKUP, or RANDO.
  138. @ECHO  
  139. @ECHO  ************** WE TRUST THAT YOU'LL ENJOY STATHELP *******************
  140. @ECHO  
  141. GOTO END
  142. :BAD2DRIV
  143. @ECHO  
  144. @ECHO 
  145. @ECHO   DRIVE %2 COULD NOT BE ACCESSED & FILES COULD NOT BE COPIED TO IT.
  146. @ECHO  
  147. @ECHO        If this drive exists on your machine, the problem may be due
  148. @ECHO   to an error in typing the TO_Drive in the SINSTALL command.  
  149. @ECHO        You must type a colon (:) after the drive letter, and there
  150. @ECHO   must be no space between the drive letter and the colon.  For
  151. @ECHO   example, type A:, but not A : or not A without the colon.
  152. @ECHO        If you requested installation to a floppy drive, the drive door
  153. @ECHO   may be open, or the diskette may be write-protected or unformatted.
  154. @ECHO        Before running SINSTALL again, use the DIR command to confirm
  155. @ECHO   that the TO_Drive is indeed ready. 
  156. GOTO END
  157. :BAD2DIR
  158. @ECHO  
  159. @ECHO 
  160. @ECHO         DIRECTORY YOU SPECIFIED, %3, COULD NOT BE CREATED
  161. @ECHO               OR FILES COULDN'T BE COPIED TO IT.
  162. @ECHO  
  163. @ECHO    The problem may be due to an error in typing the TO_Directory name in
  164. @ECHO    the SINSTALL command.  You must precede all Directory Names with a
  165. @ECHO    backslash (\), not a slash (/).  There must be no space between the
  166. @ECHO    backslash and Name and no blank spaces in the Name itself.
  167. @ECHO         Some correct examples:  \STATHELP or \UTILS\STATHELP
  168. @ECHO         Some BAD examples: \ STATHELP or \STAT HELP or \UTILS \STATHELP
  169. @ECHO    The Name you specify must, of course, be a legitimate DOS directory
  170. @ECHO    name, with a maximum of 8 characters and no "forbidden" characters.
  171. @ECHO  
  172. GOTO END
  173. :BADFROM
  174. @ECHO  
  175. @ECHO 
  176. @ECHO COULD NOT FIND OR READ THE STATHELP ARCHIVE FILE (SHZIPARC.EXE) ON DRIVE %1
  177. @ECHO  
  178. @ECHO    The problem may be due to an error in typing the FROM_Drive name in
  179. @ECHO    the SINSTALL command: you must type a colon (:) after the drive
  180. @ECHO    letter, and there must be no space between the drive letter and
  181. @ECHO    the colon.  E.G., type A:, but not A : or A without the colon.
  182. @ECHO    If the drive name was typed properly, the problem may be due to
  183. @ECHO    changing diskettes or openning the drive door after you started
  184. @ECHO    the installation.  Before trying again, use the DIR command to see
  185. @ECHO    if the archive file SHZIPARC.EXE is indeed where you think it is.
  186. GOTO END
  187. :ZIPERROR
  188. @ECHO  
  189. @ECHO 
  190. @ECHO        AN ERROR OCCURRED IN THE UN-ARCHIVING PROCESS
  191. @ECHO         ALL STATHELP FILES WERE NOT COPIED TO DRIVE %2
  192. @ECHO  
  193. @ECHO    Try running SINSTALL again -- a few more times if necessary.
  194. @ECHO    If you continue to get this Error Message, consult the README.1ST
  195. @ECHO    file on the distribution disk for alternative install instructions.
  196. GOTO END
  197. :OOPS
  198. IF EXIST %2\WATSTAT.EXE DEL %2\WATSTAT.EXE
  199. IF EXIST %2\WATSTAT.TXT DEL %2\WATSTAT.TXT
  200. IF EXIST %2\WATSTAT.HLP DEL %2\WATSTAT.HLP
  201. IF EXIST %2\WATSTAT.INX DEL %2\WATSTAT.INX
  202. IF EXIST %2\WATUT.EXE DEL %2\WATUT.EXE
  203. IF EXIST %2\LOOKUP.EXE DEL %2\LOOKUP.EXE
  204. IF EXIST %2\RANDO.EXE DEL %2\RANDO.EXE
  205. IF EXIST %2\SHMANUAL.DOC %2\SHMANUAL.DOC
  206. @ECHO  
  207. @ECHO 
  208. @ECHO                 INSUFFICIENT DISK SPACE ON DRIVE %2
  209. @ECHO  
  210. @ECHO         Drive %2 does not have the space required (about 470K bytes) to
  211. @ECHO          hold all the STATHELP files.  If any files were copied to Drive %2,
  212. @ECHO          this install program has attempted to delete them, since they may
  213. @ECHO          have been corrupted.  However, you should use DOS's DIR command to
  214. @ECHO          see if any STATHELP files remain on Drive %2.  If so, delete them
  215. @ECHO          with DOS's ERASE or DEL commands.
  216. @ECHO  
  217. GOTO END
  218. :USAGE
  219. @ECHO  
  220. @ECHO   INSTRUCTIONS FOR RUNNING THE INSTALLATION BATCH FILE: SINSTALL.BAT
  221. @ECHO  
  222. @ECHO  First, go to the Drive you're installing FROM, by entering the appropriate
  223. @ECHO  Drive name, e.g, A:.  Then run SINSTALL by typing a command with the
  224. @ECHO  following form: 
  225. @ECHO  
  226. @ECHO              SINSTALL FROM_Drive TO_Drive TO_Directory
  227. @ECHO  
  228. @ECHO  For example, if you're installing FROM Drive A: and want to install
  229. @ECHO  TO Drive C: and TO a Directory called \STATHELP, you'd type:
  230. @ECHO  
  231. @ECHO                     SINSTALL A: C: \STATHELP
  232. @ECHO  
  233. @ECHO Always use a colon (:) after Drive letters and a backslash (\) preceding
  234. @ECHO Directory names.  If the TO_Directory doesn't exist, SINSTALL will create it.
  235. @ECHO You may specify a Sub-Directory nested under one that already exists, e.g.,
  236. @ECHO \UTILS\STATHELP, where \UTILS already exists.  It's best to install TO a hard
  237. @ECHO disk, but you may install TO a 3.5" or a High Density 5.25" floppy, if it has
  238. @ECHO at least 470K bytes of free space.  If you install TO a floppy, no TO_Directory
  239. @ECHO name is needed: SINSTALL ignores directories for floppies and won't create any
  240. @ECHO you specify.  However, it always installs to a directory on a hard disk and,
  241. @ECHO if you don't supply a name, it will use \STATHELP by default.  If you install
  242. @ECHO FROM a floppy, the FROM and TO drives must be different, e.g., installing FROM
  243. @ECHO Drive A: TO Drive A: isn't allowed.
  244. :END
  245.  
  246. 
  247.